home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 425 b | 19 lines | [TEXT/R*ch] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 8, example 1
-
- -- example of guarded code
- unglobal myArray, otherArray
-
- global myArray := new Array initialSize:10 growable:false
- global otherArray := #(1,2,3,4,5,6,7,8,9,10,11,12)
-
- -- now try to add too many items to an array
- guard
- addMany myArray otherArray
- catching
- boundedError: caught (print "Tried to add too many items" debug)
- end
- -->>>
-